<?php
class Projectcase extends Zend_Db_Table{
    	protected $_name ="project_case";
	protected $_primary = 'id';

     //根据id 查询projectcase
    public function getprojectcaseByid($id){
          $select = $this->select();
          $select->where("id=".$id);
          return $this->fetchAll($select)->toArray();
    }

         //根据project_id 查询projectcase
    public function getprojectcaseByproject_id($project_id){
          $select = $this->select();
          $select->where("project_id=".$project_id);
          return $this->fetchAll($select)->toArray();
    }
 //更新projectcase
    public function updateprojectcaseByid($array,$id){

		$db = $this->getAdapter();
		$where=$db->quoteInto('id = ?', $id);
		$this->update($array, $where);
	}
//删除projectcase
     public function delprojectcaseByid($id){
          $where = 'id = '. $id;
         $this->delete($where);
         return true;
    }

//根据project_id和case_id删除projectcase
     public function delprojectcaseByprojectid($project_id,$case_id){
          $where = "project_id='$project_id' and case_id='$case_id'";
         $this->delete($where);
         return true;
    }
}
?>
